package com.business.business.web.mapper;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.business.business.model.Business;
import com.business.business.model.construction_unit.ConstructionUnitInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface BusinessMapper extends BaseMapper<Business> {

    int getBuCount(JSONObject jsonObject);

    /**
     * 查询所有单位id
     * @return
     */
    List<Business> getBusinessId();

    /**
     * 查询所有单位
     * @return
     */
    List<Business> getBusinessList(JSONObject jsonParam);

    /**
     * 单位list
     * @return
     */
    List<Business> BusinessList(JSONObject jsonParam);

    IPage<Business> selectBusinessListPage(IPage page, @Param("param") JSONObject jsonParam);

    /**
     * 批量插入单位
     * @param list
     */
    void insertZB(List<Business> list);

    List<Business> getBusiness();

    void updateOrgId(@Param("tableName") String tableName, @Param("jsonParam") JSONObject jsonParam);

    /**
     * 更新用户到期状态用
     */
    List<Map<String,Object>> getBusinessLists();

    /**
     * @Author YangYu
     * @Description 批量更新文件
     * @Date Created in 11:53 2022/3/25
     * @Param [list]
     */

    void batchUpdate(List<Map<String,Object>> list);

    /**
     * @Author YangYu
     * @Description 单位续费更新本单位的账号状态为可用
     * @Date Created in 9:39 2022/6/22
     * @Param [businessId]
     */

    void updateUser(String businessId);

    String checkBusinessExpire(String id);

    Object selectIndustryCount(@Param("ids") List<String> ids, @Param("type") String type);
    Object selectIndustryCountOther(@Param("ids") List<String> ids);
}

